<template>
	<view>
		<uni-store-item :showList="showList" v-if="loginInfo.length"></uni-store-item>
		<view class="loginBtn" v-else>请<navigator url="/pages/login/login">登录</navigator>后查看购物车</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				storeList:[],
				loginInfo:"",
				showList:[]
			}
		},
		methods: {
			
		},
		onShow() {
			if(uni.getStorageSync("storeList")){
				this.storeList = uni.getStorageSync("storeList")
			}else{
				this.storeList = []
			}
			
			if(uni.getStorageSync("loginInfo")){
				this.loginInfo = uni.getStorageSync("loginInfo")
			}else{
				this.loginInfo = ""
			}
			let login = uni.getStorageSync("loginInfo")
			this.showList = this.storeList.filter(v=>v.loginInfo == login)
			console.log(this.showList)
		}
	}
</script>

<style lang="less">
	.loginBtn{
		display: flex;
		justify-content: center;
		font-size: 36rpx;
		padding-top: 80rpx;
		navigator{
			color: orangered;
			text-decoration: underline;
		}
	}
</style>
